import request from '@/common/request.js'

// 获取首页数据
export function getRecommendPartners(params = {}) {
	// mock接口，实际可替换为真实后端接口
	return request.httpRequest({
		url: '/api/index/getIndex',
		method: 'get',
		data: params
	})
}
// 获取组队列表
export function getTeamList(params = {}) {
	// mock接口，实际可替换为真实后端接口
	return request.httpRequest({
		url: '/api/index/getTeamList',
		method: 'get',
		data: params
	})
}

// 发布组队
export function publishPartner(params = {}) {
	// mock接口，实际可替换为真实后端接口
	return request.httpTokenRequest({
		url: '/api/index/saveTeam',
		method: 'get',
		data: params
	})
}

// 获取广场动态列表
export function getPosts(params = {}) {
	// mock接口，实际可替换为真实后端接口
	return request.httpTokenRequest({
		url: '/api/index/getPosts',
		method: 'get',
		data: params
	})
}

// 获取城市列表
export function getCityList(params = {}) {
	// mock接口，实际可替换为真实后端接口
	return request.httpTokenRequest({
		url: '/api/index/getArea',
		method: 'get',
		data: params
	})
}

// 獲取當前城市
export function getCurrentCity(params = {}) {
	// mock接口，实际可替换为真实后端接口
	return request.httpTokenRequest({
		url: '/api/index/getCity',
		method: 'get',
		data: params
	})
}

// 加入匹配
export function joinMatching(params = {}) {
  return request.httpTokenRequest({
    url: '/api/index/join',
    method: 'GET',
    data: params
  })
}

// 检查匹配结果
export function checkMatchingResult(params = {}) {
  return request.httpTokenRequest({
    url: '/api/index/checkResult',
    method: 'GET',
    data: params
  })
}

// 取消匹配
export function cancelMatching(params = {}) {
  return request.httpTokenRequest({
    url: '/api/index/cancel',
    method: 'GET',
    data: params
  })
}

// 获取附近搭友列表
export function getNearbyUsers(params = {}) {
  return request.httpTokenRequest({
    url: '/api/index/nearUser',
    method: 'get',
    data: params
  });
}
